#ifndef CAMERACONFIG_H
#define CAMERACONFIG_H

#include <map>
#include <fstream>
#include "json/json.h"
#include "public.h"
#include "mk_mediakit.h"
#include "mk_common.h"
#include "mk_util.h"
#include "mk_proxyplayer.h"
#include "public.h"
#include "device.h"
#include "filesource.h"

class CameraConfig
{
public:
    CameraConfig();
    ~CameraConfig();

    //相机配置文件读取解析
    void initConfig(const string &configFile);

    //开始代理拉流
    void startProxyPull();
    //结束代理拉流
    void stopProxyPull();

    //定时检测重连
    void doReconnect();

    //简单测试
    void proxyPullTest();

public:
    //重连定时默认30s
    int m_delayMsec = 30000;

private:
    map<string, STU_CAMERAINFO> m_mapCamInfos;
    map<string, mk_proxy_player> m_rtspProxys;
    map<string, Device *> m_usbProxys;
    map<string, FileSource *> m_fileProxys;

    //定时任务
    mk_thread m_timerThread = nullptr;
    mk_timer m_timer = nullptr;
};


#endif // CAMERACONFIG_H
